#include "waiting.h"
#include "ui_waiting.h"

Waiting::Waiting(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Waiting)
{
    ui->setupUi(this);
    //设置透明度
    setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);//设置为对话框风格，并且去掉边框

    setAttribute(Qt::WA_TranslucentBackground);//背景透明
    setWindowModality(Qt::WindowModal);//设置为模式对话框，同时在构造该对话框时要设置父窗口
    ui->label_gif->setStyleSheet("background-color: transparent;");
    m_Move = new QMovie(":/images/waitting.gif");
    ui->label_gif->setMovie(m_Move);
//    ui->label_gif->setScaledContents(true);
    m_Move->start();
}

Waiting::~Waiting()
{
    delete ui;
    m_Move->stop();
    delete m_Move;
}
